import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
      path:'/login',
      name:'login',
      component:()=>import('../views/Login/index.vue')
    },
    {
      path:'/',
      redirect:'/login',
    },
    {
      path:'/index',
      name:'index',
      component:()=>import('../views/index/index1.vue'),
    },
    {
      path:'/detail/:id?',
      name:'detail',
      component:()=>import('../views/detail/index.vue')
    },
    {
      path:'/home',
      name:'home',
      component:()=>import('../views/home/index.vue')
    },
    {
      path:'/cart',
      name:'cart',
      component:()=>import('../views/cart/index.vue')
    }
]

const router = new VueRouter({
  routes
})

export default router
